<?php

namespace Portal\LessonBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ScheduleType extends AbstractType
{
  
  private $lessonId;
  
  public static function __construct($lessonId)
  {
    $this->lessonId = $lessonId;
  }

  public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('lessonId')
            ->add('startDate')
            ->add('endDate')
            ->add('description')
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Portal\LessonBundle\Entity\Schedule'
        ));
    }

    public function getName()
    {
        return 'portal_lessonbundle_scheduletype';
    }
}
